package com.example.monit.controller;

import com.example.monit.bean.Replay;
import com.example.monit.bean.ResponseRust;
import com.example.monit.service.ReplayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/replay")
public class ReplayController {

    @Autowired
    ReplayService replayService;

    @PostMapping("/report")
    public ResponseRust report(@RequestBody Replay replay) {
//        replayService.report(replay);
        return ResponseRust.success_creat();
    }

    /**
     * 根据事件 id 查询错误回溯
     * @param eventId
     * @return
     */
    @GetMapping("/getReplayById")
    public ResponseRust getReplayById(String eventId) {
        Replay replay = replayService.getReplayByEventId(eventId);
        return ResponseRust.success(replay);
    }
}
